import {
	mapGetters
} from 'vuex'
export default {
	data() {
		return {
			marginTop: '0px', // 初始化为 '0px',
			nomalTop: '0px'
		};
	},
	mounted() {
		uni.getSystemInfo({
				success: (res) => {
					let statusBarHeight = res.statusBarHeight || 0;
					let nomalTop = res.statusBarHeight || 0;
					statusBarHeight += 84;
					nomalTop += 40
					this.marginTop = statusBarHeight + 'px';
					this.nomalTop = nomalTop + 'px';
				},
			})
			
	},
	 methods:{
		 checkLogin(){
		 	//判断登录
		 	if (!this.token) {
		 		uni.redirectTo({
		 			url: '/pages/login/login',
		 		})
		 	}
		 }
	 },
	computed: {
		...mapGetters({
			token: 'user/token',
		}),
		containerStyle() {
			return "margin-top:" + this.marginTop;
		},
		nomalStyle() {
			return "margin-top:" + this.nomalTop;
		},
	},
};